﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DownloadHomeUserControl.ascx.cs"
    Inherits="JM.JCY.SharePointComponent.DownloadCenter.DownloadHome.DownloadHomeUserControl" %>
<script type="text/javascript">
    _spOriginalFormAction = document.forms[0].action;
    _spSuppressFormOnSubmitWrapper = true;

    $(document).ready(function () {
        $("#toggleDownload1").click(function () {
            var div = document.getElementById("divToggleDownload");
            if (div.style.display == "") {
                div.style.display = "none";
                $("#imgToggleDownload").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_expand.png");

            }
            else {
                div.style.display = "";
                $("#imgToggleDownload").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_collapse.png");
            }
        });

        $("#toggleDownload2").click(function () {
            var div = document.getElementById("divToggleDownload");
            if (div.style.display == "") {
                div.style.display = "none";
                $("#imgToggleDownload").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_expand.png");

            }
            else {
                div.style.display = "";
                $("#imgToggleDownload").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_collapse.png");
            }
        });
    });
    function RedirectToViewAllPublicDocs(sender) {

        var URIScheme = "http://";
        var host = document.location.host;
        var url = URIScheme + host + "/Public/Forms/AllItems.aspx";
        sender.href = url;
    }

</script>
<div>
    <table class="main" width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td>
                <table class="webpart" width="450" cellpadding="0" cellspacing="0">
                    <tr>
                        <th align="left" align="left" id="toggleDownload1" class="title" width="50%" style="cursor: pointer">
                            <img src="/_layouts/JM.JCY.Resource/images/mohipedia_logo.PNG" width="24" />
                            下载中心
                        </th>
                        <th id="toggleDownload2" class="link" align="right" width="50%" style="cursor: pointer">
                            <img class="toggle" id="imgToggleDownload" src="/_layouts/JM.JCY.Resource/images/toggle_collapse.png" />
                        </th>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div id="divToggleDownload">
                                <table width="100%">
                                    <tr>
                                        <td width="100%">
                                            <asp:GridView ID="gvDownLoadCenter" runat="server" AutoGenerateColumns="False" EnableModelValidation="True"
                                                Width="100%" OnRowCommand="gvDownLoadCenter_RowCommand" CssClass="altrowstablebc">
                                                <Columns>
                                                    <asp:TemplateField HeaderText="标题" ShowHeader="false">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lbSubject" runat="server" Text='<%#Eval("Title")%>' CommandName="Download"
                                                                CommandArgument='<%#Eval("Link")%>'></asp:LinkButton>
                                                        </ItemTemplate>
                                                        <HeaderStyle Width="40%" />
                                                        <ItemStyle Width="40%" />
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:LinkButton ID="lbViewAllDownload" runat="server" OnClick="lbViewAllDownload_Click">更多...</asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
